<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Swagger UI</title>
  <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
  <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
  <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
  <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>

  <script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
  <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
  <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
  <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
  <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
  <script src='lib/handlebars-4.0.5.js' type='text/javascript'></script>
  <script src='lib/lodash.min.js' type='text/javascript'></script>
  <script src='lib/backbone-min.js' type='text/javascript'></script>
  <script src='swagger-ui.min.js' type='text/javascript'></script>
  <script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
  <script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
  <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
  <script src='lib/marked.js' type='text/javascript'></script>
  <script src='lib/swagger-oauth.js' type='text/javascript'></script>

  <!-- Some basic translations -->
  <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
  <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
  <!-- <script src='lang/en.js' type='text/javascript'></script> -->

  <script type="text/javascript">
    $(function () {
      var url = window.location.search.match(/url=([^&]+)/);
      if (url && url.length > 1) {
        url = decodeURIComponent(url[1]);
        var api;
        switch (url) {
          case "specfile/process/flowable-swagger-process.json":
              api = "process";
              break;
          case "specfile/idm/flowable-swagger-idm.json":
              api = "idm";
              break;    
          case "specfile/dmn/flowable-swagger-decision.json":
              api = "dmn";
              break;
          case "specfile/cmmn/flowable-swagger-cmmn.json":
              api = "cmmn";
              break;
          case "specfile/eventregistry/flowable-swagger-eventregistry.json":
              api = "eventregistry";
              break;
          case "specfile/form/flowable-swagger-form.json":
              api = "form";
              break;
          case "specfile/content/flowable-swagger-content.json":
              api = "content";
              break;
          case "specfile/app/flowable-swagger-app.json":
              api = "app";
              break;
          case "specfile/external-worker/flowable-swagger-external-worker.json":
              api = "external-worker";
              break;
      }

        if (!api) {
            window.location.search = window.location.search.replace(url, "specfile/process/flowable-swagger-process.json");
        }

        $("#api-select").val(api);
      } else {
        window.location.search=window.location.search + '?url=specfile/process/flowable-swagger-process.json';
        return;
      }

      hljs.configure({
        highlightSizeThreshold: 5000
      });

      // Pre load translate...
      if(window.SwaggerTranslator) {
        window.SwaggerTranslator.translate();
      }
      window.swaggerUi = new SwaggerUi({
        url: url,
        dom_id: "swagger-ui-container",
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        onComplete: function(swaggerApi, swaggerUi){
            if(window.SwaggerTranslator) {
            window.SwaggerTranslator.translate();
          }
        },
        onFailure: function(data) {
          log("Unable to Load SwaggerUI");
        },
        docExpansion: "none",
        jsonEditor: false,
        defaultModelRendering: 'schema',
        showRequestHeaders: false
      });

      window.swaggerUi.load();

      function log() {
        if ('console' in window) {
          console.log.apply(console, arguments);
        }
      }

      $( "#api-select" ).change(function() {
          var specFile;
          switch ($('#api-select :selected').val()) {
              case "process":
                  specFile = "specfile/process/flowable-swagger-process.json";
                  break;
              case "idm":
                  specFile = "specfile/idm/flowable-swagger-idm.json";
                  break;    
              case "dmn":
                  specFile = "specfile/dmn/flowable-swagger-decision.json";
                  break;
              case "cmmn":
                  specFile = "specfile/cmmn/flowable-swagger-cmmn.json";
                  break;
              case "eventregistry":
                  specFile = "specfile/eventregistry/flowable-swagger-eventregistry.json";
                  break;
              case "form":
                  specFile = "specfile/form/flowable-swagger-form.json";
                  break;
              case "content":
                  specFile = "specfile/content/flowable-swagger-content.json";
                  break;
              case "app":
                  specFile = "specfile/app/flowable-swagger-app.json";
                  break;
              case "external-worker":
                  specFile = "specfile/external-worker/flowable-swagger-external-worker.json";
                  break;
          }

          var url = window.location.search.match(/url=([^&]+)/);
          if (url && url.length > 1) {
              window.location.hash = "";
              window.location.search = window.location.search.replace(url[1], specFile);
          }
      });
  });

    //
  </script>
</head>

<body class="swagger-section">
<div id='header'>
  <div class="swagger-ui-wrap">
    <a id="logo" href="http://swagger.io"><img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" /><span class="logo__title">swagger</span></a>
      <div style="float: right; margin-top: 8px;">
        API:
        <select id="api-select" style="margin-left: 5px;">
          <option value="process">Process</option>
          <option value="idm">IDM</option>
          <option value="dmn">DMN</option>
          <option value="cmmn">CMMN</option>
          <option value="eventregistry">Event Registry</option>
          <option value="form">Form</option>
          <option value="content">Content</option>
          <option value="app">App</option>
          <option value="external-worker">External Worker</option>
        </select>
      </div>
  </div>
</div>

<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
